#-------------------------------------------------
# Project created by QtCreator 2025-06-02T22:58:23
# Modified for RPATH fix and dependency handling
#-------------------------------------------------

QT       -= gui
PROJECT_NAME = CommGWMgr
TARGET = SyncBase6RW
TEMPLATE = lib
CONFIG += shared    # 生成动态库 (.so)

DEFINES += PLUGINSSHARED_LIBRARY
DEFINES += QT_DEPRECATED_WARNINGS

#project file
include($$PWD/../../CommGWMgr/project.pri)

INCLUDEPATH += \
    $$PWD/include

SOURCES += \
    csyncbasethread.cpp \
    log.cpp \
    SyncBase6RW.cpp

HEADERS += \
    csyncbasethread.h \
    header.h \
    log.h \
    SyncBase6RW.h

# UNIX 专用配置（关键修改2：RPATH 和依赖处理）
unix {
    # RPATH 配置（转义修复）
    QMAKE_LFLAGS += -Wl,-rpath=\$$ORIGIN
    # 构建后自动复制依赖库（关键修改3）
    QMAKE_POSTLINK += $$quote(cp -f $$PWD/lib/libDataCommon.so $$DESTDIR/)
    QMAKE_POSTLINK += $$quote(cp -f $$PWD/lib/libSyncBaseApi60.so $$DESTDIR/)
}

# 库链接配置
LIBS += -L$$PWD/lib/ \
    -lDataCommon \
    -lSyncBaseApi60
